<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Fly Prod - Administration</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="stylesheet" type="text/css" href="../default.css" />
        <script type="text/javascript" src="../scripts.js"></script>
    </head>
    <body>
        <div id="upbg"></div>
        <div id="outer">
            <?php
            include '../headerAdmin.php';
            include '../menuAdmin.php';
            ?>
            <div id="content">
                <?php
                include_once '../connectBDD.php';

                //Recherche des événements
                $result = mysql_query("SELECT name_event, id_event, star_event FROM event order by date_event desc");
                $nb_res = mysql_num_rows($result);
                echo"<div class='sousTitreInfoInscription'>Gestion des événements</div>";
                echo"<div id='content_event'>";
                echo "<div><a href=javascript:ouvrirFenetre('creationEvenement.php')>Creer un nouvel événement</a></div>";
                echo "<div style='color:green'>$nb_res événement(s) trouvé(s)</div>";
                if (mysql_num_rows($result) <= 0) {
                    echo "<div class='no_result_found'>Aucun événement.</div>";
                } else {
                    echo "<div class='events'>";
                    while ($row = mysql_fetch_assoc($result)) {
                        echo"
                         <div id='event'>
                            <a href='../detailEvenement.php?idEvent=" . $row['id_event'] . "'>" . $row['name_event'] . "</a>";
                        //Si l'event est une star event on affiche l'étoile
                        if($row['star_event'] == '1'){
                            echo "<img id='star' src='../images/Star-32.png'/>";
                        }
                        echo"<div style='float:right'>
                                <a class='edit_data' href=\"javascript:ouvrirFenetre('creationEvenement.php?idEvent=" . $row['id_event']."')\"><img src='../images/Edit_Yes_32.png' /></a>
                                <a class='bulle_com' href=\"javascript:ouvrirFenetre('gestionCommentaires.php?idEvent=" . $row['id_event']."')\"><img src='../images/Speech-Bubble-32.png' height='20px' width='20px' /></a>
                                <a class='croix_ferm' href=\"javascript:supprimerEvenement('" . $row['id_event'] . "')\"><img src='../images/Close-32.png' height='17px' width='15px'/></a>
                            </div>
                        </div>";
                    }
                    echo "</div>";
                }
                echo "</div>";
                ?>

            </div>
            <?php
            include '../footer.php';
            ?>
        </div>
    </body>
</html>